package com.example.demo.mapper;

import com.example.demo.pojo.entity.ForumComment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ForumCommentMapper {
    @Select("select count(id) from forum_comment where forum_id=#{forumId}")
    Integer getCommentNumByForumId(Long forumId);

    @Insert("insert into forum_comment (forum_id, user_id, comment, create_time) VALUES " +
            "(#{forumId},#{userId},#{comment},#{createTime})")
    void insert(ForumComment forumComment);
}
